//package com.batch.quartz.batch;
//
//import com.batch.quartz.config.CommonConfig;
//import com.batch.quartz.entity.PiLiangCustomer;
//import com.batch.quartz.processor.PiLiangFileProcessor;
//import com.batch.quartz.reader.CommonFileReader;
//import com.batch.quartz.writer.PiLiangFileWriter;
//import org.springframework.batch.core.Job;
//import org.springframework.batch.core.Step;
//import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
//import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
//import org.springframework.batch.core.configuration.annotation.StepScope;
//import org.springframework.batch.core.launch.support.RunIdIncrementer;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * <h3>springboot_batch_jdbc</h3>
// * <p>批量配置</p>
// *
// * @author : hduong
// * @version : 1.0
// * @date : 2019-12-06 16:59
// **/
//@Configuration
//public class PiLiangConfig extends CommonConfig{
//
//    public PiLiangConfig(JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory) {
//        super(jobBuilderFactory, stepBuilderFactory);
//    }
//
//    @Bean
//    public Job piLiangJob() {
//        return jobBuilderFactory.get("piLiangJob")
//                .incrementer(new RunIdIncrementer())
//                .start(piLiangStep())
//                .build();
//    }
//
//    @Bean
//    public Step piLiangStep() {
//        return stepBuilderFactory.get("piLiangStep")
//                .<PiLiangCustomer, PiLiangCustomer>chunk(10)
//                .reader(commonFileReader(null))
//                .processor(piLiangFileProcessor())
//                .writer(piLiangFileWriter())
//                .build();
//    }
//
//    @Bean
//    public PiLiangFileWriter piLiangFileWriter() {
//        return new PiLiangFileWriter();
//    }
//
//    @Bean
//    public PiLiangFileProcessor piLiangFileProcessor() {
//        return new PiLiangFileProcessor();
//    }
//
//    @Bean
//    @StepScope
//    public CommonFileReader commonFileReader(@Value("#{jobParameters[fileName]}") String fileName) {
//        return new CommonFileReader(fileName, PiLiangCustomer.class, ",",null);
//    }
//
//}
